package br.com.main.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DeckPanel;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;

public class DialogBoxCadastro extends DialogBox {
	private DeckPanel painel;

	public DialogBoxCadastro(DeckPanel deck) {
		super(false);
		painel = deck;
		setText("Cadastrado com sucesso!");

		Button btOk = new Button("OK");
		btOk.addStyleName("botaoCenter");

		VerticalPanel vPanel = new VerticalPanel();
		vPanel.add(new Label("Seu cadastro foi efetivado com sucesso!"));
		vPanel.add(btOk);

		setWidget(vPanel);
		setAnimationEnabled(true);
		setGlassEnabled(true);
		center();

		btOk.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				hide();
				painel.showWidget(0);
			}
		});
	}

}
